<template>
  <div>
       <van-nav-bar title="修改个人信息" right-text="保存" left-arrow @click-left="onClickLeft" @click-right="onClickRight" />
       <van-field v-model="value" placeholder="请输入用户名" />
  </div>
</template>

<script>
import {lzuserInfo,lzupdate} from '../../utils/http'
export default {
  name: "",
  components: {},
  props: [],
  data() {
    return {
      value:''
    };
  },
  mounted() {
    this.getUserInfo()
  },
  methods: {
    //获取个人信息
    async getUserInfo(){
      const res=await lzuserInfo()
      this.value=res.nickname
    
    },
       onClickLeft() {
      this.$router.push("/mine");
    },
   async onClickRight(){
     let data=this.value
       const res=await lzupdate(data)
        this.getUserInfo()
        this.$router.push('/personal')
    }
  },
  computed: {},
  watch: {},
  created() {},
};
</script>

<style scoped>
</style>
